package cn.stylefeng.guns.sys.modular.system.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.entity.GroupNoticeReceive;
import cn.stylefeng.guns.sys.modular.system.model.params.GroupNoticeReceiveParam;
import cn.stylefeng.guns.sys.modular.system.service.GroupNoticeReceiveService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 群通接收表控制器
 *
 * @author jiangge
 * @Date 2021-07-26 13:21:06
 */
@Controller
@RequestMapping("/groupNoticeReceive")
public class GroupNoticeReceiveController extends BaseController {

    private String PREFIX = "/modular/system/groupNoticeReceive";

    @Autowired
    private GroupNoticeReceiveService groupNoticeReceiveService;

    /**
     * 跳转到主页面
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/groupNoticeReceive.html";
    }

    /**
     * 新增页面
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @RequestMapping("/add")
    public String add() {
        return PREFIX + "/groupNoticeReceive_add.html";
    }

    /**
     * 编辑页面
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @RequestMapping("/edit")
    public String edit() {
        return PREFIX + "/groupNoticeReceive_edit.html";
    }

    /**
     * 新增接口
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @RequestMapping("/addItem")
    @ResponseBody
    public ResponseData addItem(GroupNoticeReceiveParam groupNoticeReceiveParam) {
        this.groupNoticeReceiveService.add(groupNoticeReceiveParam);
        return ResponseData.success();
    }

    /**
     * 编辑接口
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @RequestMapping("/editItem")
    @ResponseBody
    public ResponseData editItem(GroupNoticeReceiveParam groupNoticeReceiveParam) {
        this.groupNoticeReceiveService.update(groupNoticeReceiveParam);
        return ResponseData.success();
    }

    /**
     * 删除接口
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @RequestMapping("/delete")
    @ResponseBody
    public ResponseData delete(GroupNoticeReceiveParam groupNoticeReceiveParam) {
        this.groupNoticeReceiveService.delete(groupNoticeReceiveParam);
        return ResponseData.success();
    }

    /**
     * 查看详情接口
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @RequestMapping("/detail")
    @ResponseBody
    public ResponseData detail(GroupNoticeReceiveParam groupNoticeReceiveParam) {
        GroupNoticeReceive detail = this.groupNoticeReceiveService.getById(groupNoticeReceiveParam.getReceiveId());
        return ResponseData.success(detail);
    }

    /**
     * 查询列表
     *
     * @author jiangge
     * @Date 2021-07-26
     */
    @ResponseBody
    @RequestMapping("/list")
    public LayuiPageInfo list(GroupNoticeReceiveParam groupNoticeReceiveParam) {
        return this.groupNoticeReceiveService.findPageBySpec(groupNoticeReceiveParam);
    }

}


